<template>
  <div class="scene-launch-screen">
    <transition name="fade" v-on:after-enter="afterEnter" v-on:after-leave="afterLeave">
      <div v-if="sign === 1">
        <div><img src="@/assets/logo.png" /></div>
        <div>Produced by Lanmingyan</div>
      </div>
    </transition>
  </div>
</template>

<script>
export default {
  name: 'SceneLaunchScreen',
  data() {
    return {
      sign: 0,
    }
  },

  mounted() {
    this.sign = 1
  },

  methods: {
    afterEnter() {
      this.sign = 0
    },
    afterLeave() {
      this.$emit('end')
    },
  }
}
</script>

<style lang="scss" scoped>
.scene-launch-screen {
  display: flex;
  justify-content: center;
  align-items: center;
  flex-direction: column;
  height: 100%;
  font-size: 42px;
  color: #F7FFF7;
  background-color: #1C1C1C;
  text-align: center;
}

.fade-enter-active {
  transition: opacity 1s ease-in 1s;
}

.fade-leave-active {
  transition: opacity 1s ease-out 2s;
}

.fade-enter,
.fade-leave-to {
  opacity: 0;
}
</style>
